package wedaex.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringEscapeUtils;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import wedaex.content.Page;
import wedaex.helper.SessionUtils;

public class ConstructRegExpController implements Controller {

	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
		Page p = SessionUtils.getPage(request);

		ModelAndView mv = new ModelAndView("constructRegExp");
		mv.addObject("contentSource", StringEscapeUtils.escapeHtml(p.getSource().toString()));
		mv.addObject("content", StringEscapeUtils.escapeHtml(p.getContent()));
		return mv;
	}

}
